﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using gregn6Lib;
using System.Configuration;
using Common;
using System.IO;
using DevExpress.XtraEditors;
using SQLDLL;
using NursingFormSystem.KnowingAgreeBook;
using NursingFormSystem.NurFormsService;
using NursingFormSystem.Model;
using NursingFormSystem.Common;

namespace NursingFormSystem.NursingSurgery
{
    public partial class SurgeryPrints : Form
    {
        private GridppReport Report = new GridppReport();
        NurFormsService.NursingForm formService = new NurFormsService.NursingForm();
        PatientInfo PatientInfo;
        DateTime Start;
        DateTime End;
        public SurgeryPrints(PatientInfo patientInfo,DateTime StartDate, DateTime EndDate)
        {
            InitializeComponent();
            PatientInfo = patientInfo;
            Start = StartDate;
            End = EndDate;
            Report.LoadFromFile(System.Windows.Forms.Application.StartupPath + @"\GRFModel\Ydhl_GRF\介入室手术-有创操作安全核查记录.grf");
            Report.ConnectionString = Utility.GetDatabaseConnectionString();
            Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecord);
            axGRPrintViewer1.Report = Report;
        }

        private void ReportFetchRecord()
        {
            var ret = formService.GetNursingFormRecordByDate(PatientInfo.PATIENT_ID, PatientInfo.VISIT_ID, (int)FormType.SheetSafeChkRecord, Start, End);
            DataTable dt = new DataTable();
            if (ret.Code == 1)
            {
                CreateDataTableHead(dt);
                List<NursingFormRecord> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<NursingFormRecord>>(ret.D);
                list = list.OrderByDescending(p => p.AssessmentDate).ToList();
                for (int i = 0; i < list.Count; i++)
                {
                    NursingFormRecord record1 = list[i];
                    OperationNote ps = XmlUtil.XMLToObject<OperationNote>(record1.NursingFormData, Encoding.UTF8);
                    dt.Rows.Add(
                        PatientInfo.DEPARTMENT_NAME,//DEPARTMENT_NAME
                        PatientInfo.NURSE_CELL_NAME,//NURSE_CELL_NAME
                        PatientInfo.BED_NO,//BED_NO
                        PatientInfo.PATIENT_NAME,
                        PatientInfo.SEX,//SEX
                        PatientInfo.AGE,//AGE
                        PatientInfo.PATIENT_ID,//PATIENTID
                        PatientInfo.IN_DATE,//入院日期
                        ps.RiQi,
                        ps.NiShouShuMingCheng,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.CaoZuoQianJianKangJiaoYu.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.CaoZuoQianJianKangJiaoYu.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.YiShi.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.YiShi.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.YiShi.Equals("2") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.YiShi.Equals("3") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.WanDai.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.WanDai.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.YaoWuGuoMin.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.YaoWuGuoMin.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.YaoWuGuoMinWenBenKuang,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.PiFuZhunBei.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.PiFuZhunBei.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.JiaoChaPeiXue.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.JiaoChaPeiXue.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.PiFuQingKuang.Split('#')[0].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.PiFuQingKuang.Split('#')[1].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.PiFuQingKuang.Split('#')[2].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.PiFuQingKuangBuWei,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.TengTong.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.TengTong.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.TengTongBuWei,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.TengTongFenZhi,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengTiWen,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengMaiBo,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengHuXi,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengXueYa1,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengXueYa2,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengTiZhong,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.JingMaiTongLu.Split('#')[0].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.JingMaiTongLu.Split('#')[1].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.JingMaiTongLu.Split('#')[2].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.JingMaiTongLu.Split('#')[3].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.JingMaiTongLu.Split('#')[4].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.JingMaiTongLuBuWei,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.LiuZhiDaoNiaoGuan.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.LiuZhiDaoNiaoGuan.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.LiuZhiDaoNiaoGuan.Equals("2") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.LiuZhiWeiGuan.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.LiuZhiWeiGuan.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.YinLiuGuan.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.YinLiuGuan.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.YinLiuGuanMingCheng,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.CaoZuoQianBiaoJi.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.CaoZuoQianBiaoJi.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.CaoZuoQianYongYao.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.CaoZuoQianYongYao.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.DaiRuYaoWu,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPin.Split('#')[0].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPin.Split('#')[1].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPin.Split('#')[2].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPin.Split('#')[3].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPin.Split('#')[4].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPin.Split('#')[5].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPinQiTa,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.JiaoJieShiJian,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.JiaoBanHuShi,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.JieBanHuShi,
                        ps.CaoZuoQianZhunBeiYuJiaoJie.RaoXingJiZhen.Equals("1") ? "是" : "否",
                        ps.CaoZuoQianZhunBeiHeDui.ZhenJingZhiQing.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.ZhenJingZhiQing.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.ZhenJingZhiQing.Equals("2") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.ZhenJingYongYao.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.ZhenJingYongYao.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.ZhenJingYongYao.Equals("2") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.ZhiQingTongYiShu.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.ZhiQingTongYiShu.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.ZhiQingTongYiShu.Equals("2") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.CaoZuoQianZhunBeiJiuXu.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.CaoZuoQianZhunBeiJiuXu.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.CaoZuoQianZhunBeiJiuXu.Equals("2") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.SuoXuYaoPin.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.SuoXuYaoPin.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.SuoXuYaoPin.Equals("2") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.TeShuHaoCai.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.TeShuHaoCai.Equals("0") ? "1" : string.Empty,

                        ps.CaoZuoQianZhunBeiHeDui.MingCheng.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.MingCheng.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.MingCheng.Equals("2") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.BingRenShenFenShiBieHeDui.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZhunBeiHeDui.BingRenShenFenShiBieHeDui.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.BingRenXingMing.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.BingRenXingMing.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.BingRenXingMing.Equals("2") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.ZhuYuanHao.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.ZhuYuanHao.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.ZhuYuanHao.Equals("2") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.CaoZuoMingCheng.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.CaoZuoMingCheng.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.CaoZuoMingCheng.Equals("2") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.ShouShuBuWei.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.ShouShuBuWei.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.ShouShuBuWei.Equals("2") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.CaoZuoBuWei,
                        ps.CaoZuoQianZanTingHeDui.CaoZuoTiWei.Split('#')[0].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.CaoZuoTiWei.Split('#')[1].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.CaoZuoTiWei.Split('#')[2].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoQianZanTingHeDui.CaoZuoTiWeiWenBenKuang,
                        ps.CaoZuoQianZanTingHeDui.CaoZuoKaiShiShiJian,
                        ps.CaoZuoQianZhunBeiHeDui.YiShi,
                        ps.CaoZuoQianZhunBeiHeDui.MaZui,
                        ps.CaoZuoQianZhunBeiHeDui.HuShi,
                        ps.CaoZuoZhongGuanChaJiLu.ZaoYingJi.Split('#')[0].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoZhongGuanChaJiLu.ZaoYingJi.Split('#')[1].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoZhongGuanChaJiLu.ZaoYingJi.Split('#')[2].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoZhongGuanChaJiLu.ZaoYingJi.Split('#')[3].Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoZhongGuanChaJiLu.ZaoYingJiQiTa,
                        ps.CaoZuoZhongGuanChaJiLu.ShiJian1,
                        ps.CaoZuoZhongGuanChaJiLu.ShiJian2,
                        ps.CaoZuoZhongGuanChaJiLu.ShiJian3,
                        ps.CaoZuoZhongGuanChaJiLu.ShiJian4,
                        ps.CaoZuoZhongGuanChaJiLu.ShiJian5,
                        ps.CaoZuoZhongGuanChaJiLu.ShiJian6,
                        ps.CaoZuoZhongGuanChaJiLu.ShiJian7,
                        ps.CaoZuoZhongGuanChaJiLu.ShiJian8,
                        ps.CaoZuoZhongGuanChaJiLu.ShiJian9,
                        ps.CaoZuoZhongGuanChaJiLu.XueYa1,
                        ps.CaoZuoZhongGuanChaJiLu.XueYa2,
                        ps.CaoZuoZhongGuanChaJiLu.XueYa3,
                        ps.CaoZuoZhongGuanChaJiLu.XueYa4,
                        ps.CaoZuoZhongGuanChaJiLu.XueYa5,
                        ps.CaoZuoZhongGuanChaJiLu.XueYa6,
                        ps.CaoZuoZhongGuanChaJiLu.XueYa7,
                        ps.CaoZuoZhongGuanChaJiLu.XueYa8,
                        ps.CaoZuoZhongGuanChaJiLu.XueYa9,
                        ps.CaoZuoZhongGuanChaJiLu.XinLv1,
                        ps.CaoZuoZhongGuanChaJiLu.XinLv2,
                        ps.CaoZuoZhongGuanChaJiLu.XinLv3,
                        ps.CaoZuoZhongGuanChaJiLu.XinLv4,
                        ps.CaoZuoZhongGuanChaJiLu.XinLv5,
                        ps.CaoZuoZhongGuanChaJiLu.XinLv6,
                        ps.CaoZuoZhongGuanChaJiLu.XinLv7,
                        ps.CaoZuoZhongGuanChaJiLu.XinLv8,
                        ps.CaoZuoZhongGuanChaJiLu.XinLv9,
                        ps.CaoZuoZhongGuanChaJiLu.HuXi1,
                        ps.CaoZuoZhongGuanChaJiLu.HuXi2,
                        ps.CaoZuoZhongGuanChaJiLu.HuXi3,
                        ps.CaoZuoZhongGuanChaJiLu.HuXi4,
                        ps.CaoZuoZhongGuanChaJiLu.HuXi5,
                        ps.CaoZuoZhongGuanChaJiLu.HuXi6,
                        ps.CaoZuoZhongGuanChaJiLu.HuXi7,
                        ps.CaoZuoZhongGuanChaJiLu.HuXi8,
                        ps.CaoZuoZhongGuanChaJiLu.HuXi9,
                        ps.CaoZuoZhongGuanChaJiLu.CaoZuoZhongYongYao,
                        ps.CaoZuoZhongGuanChaJiLu.BingQingJiLu,
                        ps.CaoZuoZhongGuanChaJiLu.BingQingJiLuHuShi,
                        ps.CaoZuoZhongGuanChaJiLu.CaoZuoJieShuShiJian,
                        ps.CaoZuoZhongGuanChaJiLu.CaoZuoZhongLiuZhiBiaoBen.Equals("0") ? "1" : string.Empty,
                        ps.CaoZuoZhongGuanChaJiLu.CaoZuoZhongLiuZhiBiaoBen.Equals("1") ? "1" : string.Empty,
                        ps.CaoZuoZhongGuanChaJiLu.CaoZuoZhongLiuZhiBiaoBenGeShu,
                        ps.CaoZuoZhongGuanChaJiLu.ShiJiShouShuMingCheng,
                        ps.CaoZuoZhongGuanChaJiLu.ZhiXingShiJian,
                        ps.CaoZuoZhongGuanChaJiLu.YiShuXie.Equals("0") ? "1" : string.Empty,
                         ps.CaoZuoZhongGuanChaJiLu.YiShuXie.Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoZhongGuanChaJiLu.YiShuXie.Equals("2") ? "1" : string.Empty,
                         ps.CaoZuoZhongGuanChaJiLu.YiQingDian.Equals("0") ? "1" : string.Empty,
                         ps.CaoZuoZhongGuanChaJiLu.YiQingDian.Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoZhongGuanChaJiLu.YiQingDian.Equals("2") ? "1" : string.Empty,
                          ps.CaoZuoZhongGuanChaJiLu.QueRenShouShu.Equals("0") ? "1" : string.Empty,
                         ps.CaoZuoZhongGuanChaJiLu.QueRenShouShu.Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoZhongGuanChaJiLu.QueRenShouShu.Equals("2") ? "1" : string.Empty,
                          ps.CaoZuoZhongGuanChaJiLu.JianChaSheBei.Equals("0") ? "1" : string.Empty,
                         ps.CaoZuoZhongGuanChaJiLu.JianChaSheBei.Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoZhongGuanChaJiLu.JianChaSheBei.Equals("2") ? "1" : string.Empty,
                         ps.CaoZuoZhongGuanChaJiLu.YiShi,
                         ps.CaoZuoZhongGuanChaJiLu.MaZui,
                         ps.CaoZuoZhongGuanChaJiLu.HuShi,
                         ps.CaoZuoHouJiaoJie.CaoZuoZhongYunZhuanFangShi.Split('#')[0].Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.CaoZuoZhongYunZhuanFangShi.Split('#')[1].Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.CaoZuoZhongYunZhuanFangShi.Split('#')[2].Equals("1") ? "1" : string.Empty,
                           ps.CaoZuoHouJiaoJie.YiShiZhuangTai.Split('#')[0].Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.YiShiZhuangTai.Split('#')[1].Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.YiShiZhuangTai.Split('#')[2].Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.YiShiZhuangTai.Split('#')[3].Equals("1") ? "1" : string.Empty,
                      !string.IsNullOrEmpty(ps.CaoZuoHouJiaoJie.YiShiZhuangTai) && ps.CaoZuoHouJiaoJie.YiShiZhuangTai.Split('#').Length == 5 && ps.CaoZuoHouJiaoJie.YiShiZhuangTai.Split('#')[4].Equals("1") ? "1" : string.Empty,
                          ps.CaoZuoHouJiaoJie.PiFuQingKuang.Split('#')[0].Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.PiFuQingKuang.Split('#')[1].Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.PiFuQingKuang.Split('#')[2].Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.PiFuQingKuangBuWei,
                         ps.CaoZuoHouJiaoJie.JingMaiTongLu.Split('#')[0].Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.JingMaiTongLu.Split('#')[1].Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.JingMaiTongLu.Split('#')[2].Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.JingMaiTongLu.Split('#')[3].Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.JingMaiTongLu.Split('#')[4].Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.JingMaiTongLuBuWei,
                         ps.CaoZuoHouJiaoJie.CaoZuoZhongLiuZhiYinLiuGuan.Equals("0") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.CaoZuoZhongLiuZhiYinLiuGuan.Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.CaoZuoZhongLiuZhiYinLiuGuanWeiZhi,
                         ps.CaoZuoHouJiaoJie.ShengMingTiZhengMaiBo,
                         ps.CaoZuoHouJiaoJie.ShengMingTiZhengHuXi,
                         ps.CaoZuoHouJiaoJie.ShengMingTiZhengXueYa1,
                         ps.CaoZuoHouJiaoJie.ShengMingTiZhengXueYa2,
                         ps.CaoZuoHouJiaoJie.CaoZuoHouTengTong.Equals("0") ? "1" : string.Empty,
                          ps.CaoZuoHouJiaoJie.CaoZuoHouTengTong.Equals("1") ? "1" : string.Empty,
                          ps.CaoZuoHouJiaoJie.CaoZuoHouTengTongBuWei,
                          ps.CaoZuoHouJiaoJie.CaoZuoHouTengTongFenZhi,
                          ps.CaoZuoHouJiaoJie.DaiHuiYaoPin,
                          ps.CaoZuoHouJiaoJie.DaiHuiWuPin.Split('#')[0].Equals("1") ? "1" : string.Empty,
                          ps.CaoZuoHouJiaoJie.DaiHuiWuPin.Split('#')[1].Equals("1") ? "1" : string.Empty,
                            ps.CaoZuoHouJiaoJie.DaiHuiWuPin.Split('#')[2].Equals("1") ? "1" : string.Empty,
                            ps.CaoZuoHouJiaoJie.DaiHuiWuPin.Split('#')[3].Equals("1") ? "1" : string.Empty,
                             ps.CaoZuoHouJiaoJie.DaiHuiWuPin.Split('#')[4].Equals("1") ? "1" : string.Empty,
                            ps.CaoZuoHouJiaoJie.DaiHuiWuPin.Split('#')[5].Equals("1") ? "1" : string.Empty,
                            ps.CaoZuoHouJiaoJie.DaiHuiWuPinQiTa,
                             ps.CaoZuoHouJiaoJie.HuanZheQuXiang.Split('#')[0].Equals("1") ? "1" : string.Empty,
                          ps.CaoZuoHouJiaoJie.HuanZheQuXiang.Split('#')[1].Equals("1") ? "1" : string.Empty,
                            ps.CaoZuoHouJiaoJie.HuanZheQuXiang.Split('#')[2].Equals("1") ? "1" : string.Empty,
                            ps.CaoZuoHouJiaoJie.HuanZheQuXiang.Split('#')[3].Equals("1") ? "1" : string.Empty,
                             ps.CaoZuoHouJiaoJie.HuanZheQuXiang.Split('#')[4].Equals("1") ? "1" : string.Empty,
                            ps.CaoZuoHouJiaoJie.HuanZheQuXiang.Split('#')[5].Equals("1") ? "1" : string.Empty,
                            ps.CaoZuoHouJiaoJie.HuanZheQuXiang.Split('#')[6].Equals("1") ? "1" : string.Empty,
                         ps.CaoZuoHouJiaoJie.JiaoJieShiJian,
                         ps.CaoZuoHouJiaoJie.JiaoBanHuShi,
                         ps.CaoZuoHouJiaoJie.JieBanHuShi,
                         ps.CaoZuoHouJiaoJie.TiNeiZhiRuWuHeGeZhengZhanTieChu,

                       ChkStr(ps.MaZuiHuiFuShiJiaoJie.YunZhuanFangShi, 3) && ps.MaZuiHuiFuShiJiaoJie.YunZhuanFangShi.Split('#')[0].Equals("1") ? "1" : string.Empty,
                       ChkStr(ps.MaZuiHuiFuShiJiaoJie.YunZhuanFangShi, 3) && ps.MaZuiHuiFuShiJiaoJie.YunZhuanFangShi.Split('#')[1].Equals("1") ? "1" : string.Empty,
                       ChkStr(ps.MaZuiHuiFuShiJiaoJie.YunZhuanFangShi, 3) && ps.MaZuiHuiFuShiJiaoJie.YunZhuanFangShi.Split('#')[2].Equals("1") ? "1" : string.Empty,

                       ChkStr(ps.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai, 5) && ps.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai.Split('#')[0].Equals("1") ? "1" : string.Empty,
                        ChkStr(ps.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai, 5) && ps.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai.Split('#')[1].Equals("1") ? "1" : string.Empty,
                        ChkStr(ps.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai, 5) && ps.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai.Split('#')[2].Equals("1") ? "1" : string.Empty,
                       ChkStr(ps.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai, 5) && ps.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai.Split('#')[3].Equals("1") ? "1" : string.Empty,
                        ChkStr(ps.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai, 5) && ps.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai.Split('#')[4].Equals("1") ? "1" : string.Empty,

                     ChkStr(ps.MaZuiHuiFuShiJiaoJie.PiFuQingKuang, 3) && ps.MaZuiHuiFuShiJiaoJie.PiFuQingKuang.Split('#')[0].Equals("1") ? "1" : string.Empty,
                       ChkStr(ps.MaZuiHuiFuShiJiaoJie.PiFuQingKuang, 3) && ps.MaZuiHuiFuShiJiaoJie.PiFuQingKuang.Split('#')[1].Equals("1") ? "1" : string.Empty,
                      ChkStr(ps.MaZuiHuiFuShiJiaoJie.PiFuQingKuang, 3) && ps.MaZuiHuiFuShiJiaoJie.PiFuQingKuang.Split('#')[2].Equals("1") ? "1" : string.Empty,
                         ps.MaZuiHuiFuShiJiaoJie.PiFuQingKuangBuWei,

                         ChkStr(ps.MaZuiHuiFuShiJiaoJie.JingMaiTongLu, 5) && ps.MaZuiHuiFuShiJiaoJie.JingMaiTongLu.Split('#')[0].Equals("1") ? "1" : string.Empty,
                         ChkStr(ps.MaZuiHuiFuShiJiaoJie.JingMaiTongLu, 5) && ps.MaZuiHuiFuShiJiaoJie.JingMaiTongLu.Split('#')[1].Equals("1") ? "1" : string.Empty,
                        ChkStr(ps.MaZuiHuiFuShiJiaoJie.JingMaiTongLu, 5) && ps.MaZuiHuiFuShiJiaoJie.JingMaiTongLu.Split('#')[2].Equals("1") ? "1" : string.Empty,
                        ChkStr(ps.MaZuiHuiFuShiJiaoJie.JingMaiTongLu, 5) && ps.MaZuiHuiFuShiJiaoJie.JingMaiTongLu.Split('#')[3].Equals("1") ? "1" : string.Empty,
                        ChkStr(ps.MaZuiHuiFuShiJiaoJie.JingMaiTongLu, 5) && ps.MaZuiHuiFuShiJiaoJie.JingMaiTongLu.Split('#')[4].Equals("1") ? "1" : string.Empty,
                         ps.MaZuiHuiFuShiJiaoJie.JingMaiTongLuBuWei,

                       !string.IsNullOrEmpty(ps.MaZuiHuiFuShiJiaoJie.CaoZuoZhongLiuZhiYinLiuGuan)&& ps.MaZuiHuiFuShiJiaoJie.CaoZuoZhongLiuZhiYinLiuGuan.Equals("0") ? "1" : string.Empty,
                       !string.IsNullOrEmpty(ps.MaZuiHuiFuShiJiaoJie.CaoZuoZhongLiuZhiYinLiuGuan)&& ps.MaZuiHuiFuShiJiaoJie.CaoZuoZhongLiuZhiYinLiuGuan.Equals("1") ? "1" : string.Empty,
                        ps.MaZuiHuiFuShiJiaoJie.CaoZuoZhongLiuZhiYinLiuGuanWeiZhi,

                         ps.MaZuiHuiFuShiJiaoJie.ShengMingTiZhengMaiBo,
                         ps.MaZuiHuiFuShiJiaoJie.ShengMingTiZhengHuXi,
                         ps.MaZuiHuiFuShiJiaoJie.ShengMingTiZhengXueYa1,
                         ps.MaZuiHuiFuShiJiaoJie.ShengMingTiZhengXueYa2,
                         ps.MaZuiHuiFuShiJiaoJie.TengTongFenZhi,

                         ps.MaZuiHuiFuShiJiaoJie.DaiHuiYaoPin,
                        ChkStr(ps.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin, 6) && ps.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin.Split('#')[0].Equals("1") ? "1" : string.Empty,
                         ChkStr(ps.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin, 6) && ps.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin.Split('#')[1].Equals("1") ? "1" : string.Empty,
                         ChkStr(ps.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin, 6) && ps.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin.Split('#')[2].Equals("1") ? "1" : string.Empty,
                         ChkStr(ps.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin, 6) && ps.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin.Split('#')[3].Equals("1") ? "1" : string.Empty,
                         ChkStr(ps.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin, 6) && ps.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin.Split('#')[4].Equals("1") ? "1" : string.Empty,
                         ChkStr(ps.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin, 6) && ps.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin.Split('#')[5].Equals("1") ? "1" : string.Empty,
                         ps.MaZuiHuiFuShiJiaoJie.DaiHuiWuPinQiTa,

                         ChkStr(ps.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang, 7) && ps.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang.Split('#')[0].Equals("1") ? "1" : string.Empty,
                         ChkStr(ps.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang, 7) && ps.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang.Split('#')[1].Equals("1") ? "1" : string.Empty,
                         ChkStr(ps.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang, 7) && ps.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang.Split('#')[2].Equals("1") ? "1" : string.Empty,
                         ChkStr(ps.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang, 7) && ps.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang.Split('#')[3].Equals("1") ? "1" : string.Empty,
                         ChkStr(ps.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang, 7) && ps.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang.Split('#')[4].Equals("1") ? "1" : string.Empty,
                         ChkStr(ps.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang, 7) && ps.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang.Split('#')[5].Equals("1") ? "1" : string.Empty,
                         ChkStr(ps.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang, 7) && ps.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang.Split('#')[6].Equals("1") ? "1" : string.Empty,

                         ps.MaZuiHuiFuShiJiaoJie.JiaoJieShiJian,
                         ps.MaZuiHuiFuShiJiaoJie.JiaoBanHuShi,
                         ps.MaZuiHuiFuShiJiaoJie.JieBanHuShi

                        );
                }
                Utility.FillRecordToReport(Report, dt);
            }
            else if (ret.Code == 2)
            {
                CreateDataTableHead(dt);
                DataRow dr = dt.NewRow();
                dt.Rows.Add(dr);
                Utility.FillRecordToReport(Report, dt);
            }
            else if (ret.Code == 0)
            {
                MessageBox.Show(ret.M);
            }
        }
        /// <summary>
        /// 加载列头
        /// </summary>
        /// <param name="dt"></param>
        private static void CreateDataTableHead(DataTable dt)
        {
            dt.Columns.Add("DEPARTMENT_NAME", typeof(string));
            dt.Columns.Add("NURSE_CELL_NAME", typeof(string));
            dt.Columns.Add("BED_NO", typeof(string));
            dt.Columns.Add("PatientName", typeof(string));
            dt.Columns.Add("SEX", typeof(string));
            dt.Columns.Add("AGE", typeof(string));
            dt.Columns.Add("PatientId", typeof(string));
            dt.Columns.Add("IN_DATE", typeof(string));
            dt.Columns.Add("RiQi", typeof(string));
            dt.Columns.Add("nishoushu", typeof(string));
            dt.Columns.Add("czqjiankangjiaoyu1", typeof(string));
            dt.Columns.Add("czqjiankangjiaoyu2", typeof(string));
            dt.Columns.Add("yishi1", typeof(string));
            dt.Columns.Add("yishi2", typeof(string));
            dt.Columns.Add("yishi3", typeof(string));
            dt.Columns.Add("yishi4", typeof(string));
            dt.Columns.Add("wandai1", typeof(string));
            dt.Columns.Add("wandai2", typeof(string));
            dt.Columns.Add("yaoquguomin1", typeof(string));
            dt.Columns.Add("yaoquguomin2", typeof(string));
            dt.Columns.Add("yaoquguomin3", typeof(string));
            dt.Columns.Add("pifuzhunbei1", typeof(string));
            dt.Columns.Add("pifuzhunbei2", typeof(string));
            dt.Columns.Add("jiaochapeixue1", typeof(string));
            dt.Columns.Add("jiaochapeixue2", typeof(string));
            dt.Columns.Add("pifuqingkuang1", typeof(string));
            dt.Columns.Add("pifuqingkuang2", typeof(string));
            dt.Columns.Add("pifuqingkuang3", typeof(string));
            dt.Columns.Add("pifuqingkuang4", typeof(string));
            dt.Columns.Add("tengtong1", typeof(string));
            dt.Columns.Add("tengtong2", typeof(string));
            dt.Columns.Add("tengtong3", typeof(string));
            dt.Columns.Add("tengtong4", typeof(string));
            dt.Columns.Add("shengmingtiwen", typeof(string));
            dt.Columns.Add("shengmingmaibo", typeof(string));
            dt.Columns.Add("shengminghuxi", typeof(string));
            dt.Columns.Add("shengmingxueya1", typeof(string));
            dt.Columns.Add("shengmingxueya2", typeof(string));
            dt.Columns.Add("shengmingtizhong", typeof(string));
            dt.Columns.Add("jingmaitonglu1", typeof(string));
            dt.Columns.Add("jingmaitonglu2", typeof(string));
            dt.Columns.Add("jingmaitonglu3", typeof(string));
            dt.Columns.Add("jingmaitonglu4", typeof(string));
            dt.Columns.Add("jingmaitonglu5", typeof(string));
            dt.Columns.Add("jingmaitonglu6", typeof(string));
            dt.Columns.Add("liuzhidaoniaoguan1", typeof(string));
            dt.Columns.Add("liuzhidaoniaoguan2", typeof(string));
            dt.Columns.Add("liuzhidaoniaoguan3", typeof(string));
            dt.Columns.Add("liuzhiweiguan1", typeof(string));
            dt.Columns.Add("liuzhiweiguan2", typeof(string));
            dt.Columns.Add("yinliuguan1", typeof(string));
            dt.Columns.Add("yinliuguan2", typeof(string));
            dt.Columns.Add("yinliuguan3", typeof(string));
            dt.Columns.Add("caozuoqianbiaoji1", typeof(string));
            dt.Columns.Add("caozuoqianbiaoji2", typeof(string));
            dt.Columns.Add("caozuoqianyongyao1", typeof(string));
            dt.Columns.Add("caozuoqianyongyao2", typeof(string));
            dt.Columns.Add("dairuyaowu", typeof(string));
            dt.Columns.Add("dairuwupin1", typeof(string));
            dt.Columns.Add("dairuwupin2", typeof(string));
            dt.Columns.Add("dairuwupin3", typeof(string));
            dt.Columns.Add("dairuwupin4", typeof(string));
            dt.Columns.Add("dairuwupin5", typeof(string));
            dt.Columns.Add("dairuwupin6", typeof(string));
            dt.Columns.Add("dairuwupin7", typeof(string));
            dt.Columns.Add("jiaojieshijian", typeof(string));
            dt.Columns.Add("jiaobanhushi", typeof(string));
            dt.Columns.Add("jiebanhushi", typeof(string));
            dt.Columns.Add("raoxingjizhen", typeof(string));
            dt.Columns.Add("zhenjingzhiqing1", typeof(string));
            dt.Columns.Add("zhenjingzhiqing2", typeof(string));
            dt.Columns.Add("zhenjingzhiqing3", typeof(string));
            dt.Columns.Add("zhenjingyongyao1", typeof(string));
            dt.Columns.Add("zhenjingyongyao2", typeof(string));
            dt.Columns.Add("zhenjingyongyao3", typeof(string));
            dt.Columns.Add("zhiqingtongyi1", typeof(string));
            dt.Columns.Add("zhiqingtongyi2", typeof(string));
            dt.Columns.Add("zhiqingtongyi", typeof(string));
            dt.Columns.Add("czqzhunbei1", typeof(string));
            dt.Columns.Add("czqzhunbei2", typeof(string));
            dt.Columns.Add("czqzhunbei3", typeof(string));
            dt.Columns.Add("suoxuyaopin1", typeof(string));
            dt.Columns.Add("suoxuyaopin2", typeof(string));
            dt.Columns.Add("suoxuyaopin3", typeof(string));
            dt.Columns.Add("teshuhaocai1", typeof(string));
            dt.Columns.Add("teshuhaocai2", typeof(string));
            dt.Columns.Add("teshuhaocai3", typeof(string));
            dt.Columns.Add("teshuhaocai4", typeof(string));
            dt.Columns.Add("teshuhaocai5", typeof(string));
            dt.Columns.Add("brsfsbhd1", typeof(string));
            dt.Columns.Add("brsfsbhd2", typeof(string));
            dt.Columns.Add("brxmzq1", typeof(string));
            dt.Columns.Add("brxmzq2", typeof(string));
            dt.Columns.Add("brxmzq3", typeof(string));
            dt.Columns.Add("zhuyuanhao1", typeof(string));
            dt.Columns.Add("zhuyuanhao2", typeof(string));
            dt.Columns.Add("zhuyuanhao3", typeof(string));
            dt.Columns.Add("czmczq1", typeof(string));
            dt.Columns.Add("czmczq2", typeof(string));
            dt.Columns.Add("czmczq3", typeof(string));
            dt.Columns.Add("shoushubuwei1", typeof(string));
            dt.Columns.Add("shoushubuwei2", typeof(string));
            dt.Columns.Add("shoushubuwei3", typeof(string));
            dt.Columns.Add("caozuobuwei", typeof(string));
            dt.Columns.Add("caozuotiwei1", typeof(string));
            dt.Columns.Add("caozuotiwei2", typeof(string));
            dt.Columns.Add("caozuotiwei3", typeof(string));
            dt.Columns.Add("caozuotiwei4", typeof(string));
            dt.Columns.Add("caozuokaishishijian", typeof(string));
            dt.Columns.Add("heduizheyishi", typeof(string));
            dt.Columns.Add("heduizhemazui", typeof(string));
            dt.Columns.Add("heduizhehushi", typeof(string));
            dt.Columns.Add("zaoyingji1", typeof(string));
            dt.Columns.Add("zaoyingji2", typeof(string));
            dt.Columns.Add("zaoyingji3", typeof(string));
            dt.Columns.Add("zaoyingji4", typeof(string));
            dt.Columns.Add("zaoyingji5", typeof(string));
            dt.Columns.Add("shijian1", typeof(string));
            dt.Columns.Add("shijian2", typeof(string));
            dt.Columns.Add("shijian3", typeof(string));
            dt.Columns.Add("shijian4", typeof(string));
            dt.Columns.Add("shijian5", typeof(string));
            dt.Columns.Add("shijian6", typeof(string));
            dt.Columns.Add("shijian7", typeof(string));
            dt.Columns.Add("shijian8", typeof(string));
            dt.Columns.Add("shijian9", typeof(string));
            dt.Columns.Add("xueya1", typeof(string));
            dt.Columns.Add("xueya2", typeof(string));
            dt.Columns.Add("xueya3", typeof(string));
            dt.Columns.Add("xueya4", typeof(string));
            dt.Columns.Add("xueya5", typeof(string));
            dt.Columns.Add("xueya6", typeof(string));
            dt.Columns.Add("xueya7", typeof(string));
            dt.Columns.Add("xueya8", typeof(string));
            dt.Columns.Add("xueya9", typeof(string));
            dt.Columns.Add("xinlv1", typeof(string));
            dt.Columns.Add("xinlv2", typeof(string));
            dt.Columns.Add("xinlv3", typeof(string));
            dt.Columns.Add("xinlv4", typeof(string));
            dt.Columns.Add("xinlv5", typeof(string));
            dt.Columns.Add("xinlv6", typeof(string));
            dt.Columns.Add("xinlv7", typeof(string));
            dt.Columns.Add("xinlv8", typeof(string));
            dt.Columns.Add("xinlv9", typeof(string));
            dt.Columns.Add("huxi1", typeof(string));
            dt.Columns.Add("huxi2", typeof(string));
            dt.Columns.Add("huxi3", typeof(string));
            dt.Columns.Add("huxi4", typeof(string));
            dt.Columns.Add("huxi5", typeof(string));
            dt.Columns.Add("huxi6", typeof(string));
            dt.Columns.Add("huxi7", typeof(string));
            dt.Columns.Add("huxi8", typeof(string));
            dt.Columns.Add("huxi9", typeof(string));
            dt.Columns.Add("caozuozhongyongyao", typeof(string));
            dt.Columns.Add("bingqingjilu", typeof(string));
            dt.Columns.Add("hushi", typeof(string));
            dt.Columns.Add("caozuojieshushijian", typeof(string));
            dt.Columns.Add("czzlzbb1", typeof(string));
            dt.Columns.Add("czzlzbb2", typeof(string));
            dt.Columns.Add("czzlzbb3", typeof(string));
            dt.Columns.Add("shijishoushu", typeof(string));
            dt.Columns.Add("zhixingshijian", typeof(string));
            dt.Columns.Add("yishuxie1", typeof(string));
            dt.Columns.Add("yishuxie2", typeof(string));
            dt.Columns.Add("yishuxie3", typeof(string));
            dt.Columns.Add("yiqingdian1", typeof(string));
            dt.Columns.Add("yiqingdian2", typeof(string));
            dt.Columns.Add("yiqingdian3", typeof(string));
            dt.Columns.Add("querenshou1", typeof(string));
            dt.Columns.Add("querenshou2", typeof(string));
            dt.Columns.Add("querenshou3", typeof(string));
            dt.Columns.Add("jiancha1", typeof(string));
            dt.Columns.Add("jiancha2", typeof(string));
            dt.Columns.Add("jiancha3", typeof(string));
            dt.Columns.Add("yishi", typeof(string));
            dt.Columns.Add("mazui", typeof(string));
            dt.Columns.Add("hushi2", typeof(string));
            dt.Columns.Add("czzyzfs1", typeof(string));
            dt.Columns.Add("czzyzfs2", typeof(string));
            dt.Columns.Add("czzyzfs3", typeof(string));
            dt.Columns.Add("yishizhuangtai1", typeof(string));
            dt.Columns.Add("yishizhuangtai2", typeof(string));
            dt.Columns.Add("yishizhuangtai3", typeof(string));
            dt.Columns.Add("yishizhuangtai4", typeof(string));
            dt.Columns.Add("yishizhuangtai5", typeof(string));
            dt.Columns.Add("czhpifuqingkuang1", typeof(string));
            dt.Columns.Add("czhpifuqingkuang2", typeof(string));
            dt.Columns.Add("czhpifuqingkuang3", typeof(string));
            dt.Columns.Add("czhpifuqingkuang4", typeof(string));
            dt.Columns.Add("czhjingmaitonglu1", typeof(string));
            dt.Columns.Add("czhjingmaitonglu2", typeof(string));
            dt.Columns.Add("czhjingmaitonglu3", typeof(string));
            dt.Columns.Add("czhjingmaitonglu4", typeof(string));
            dt.Columns.Add("czhjingmaitonglu5", typeof(string));
            dt.Columns.Add("czhjingmaitonglu6", typeof(string));
            dt.Columns.Add("czzlzylg1", typeof(string));
            dt.Columns.Add("czzlzylg2", typeof(string));
            dt.Columns.Add("czzlzylg3", typeof(string));
            dt.Columns.Add("smtzmaibo", typeof(string));
            dt.Columns.Add("smtzhuxi", typeof(string));
            dt.Columns.Add("smtzxueya1", typeof(string));
            dt.Columns.Add("smtzxueya2", typeof(string));
            dt.Columns.Add("czhtt1", typeof(string));
            dt.Columns.Add("czhtt2", typeof(string));
            dt.Columns.Add("czhtt3", typeof(string));
            dt.Columns.Add("czhtt4", typeof(string));
            dt.Columns.Add("daihuiyaopin", typeof(string));
            dt.Columns.Add("daihuiwupin1", typeof(string));
            dt.Columns.Add("daihuiwupin2", typeof(string));
            dt.Columns.Add("daihuiwupin3", typeof(string));
            dt.Columns.Add("daihuiwupin4", typeof(string));
            dt.Columns.Add("daihuiwupin5", typeof(string));
            dt.Columns.Add("daihuiwupin6", typeof(string));
            dt.Columns.Add("daihuiwupin7", typeof(string));
            dt.Columns.Add("huanzheqx1", typeof(string));
            dt.Columns.Add("huanzheqx2", typeof(string));
            dt.Columns.Add("huanzheqx3", typeof(string));
            dt.Columns.Add("huanzheqx4", typeof(string));
            dt.Columns.Add("huanzheqx5", typeof(string));
            dt.Columns.Add("huanzheqx6", typeof(string));
            dt.Columns.Add("huanzheqx7", typeof(string));
            dt.Columns.Add("czhjiaojieshijian", typeof(string));
            dt.Columns.Add("czhjiaobanhushi", typeof(string));
            dt.Columns.Add("czhjiebanhushi", typeof(string));
            dt.Columns.Add("tineizhiruwuhegezhengzhantiechu", typeof(string));

            dt.Columns.Add("MZHFS_YunZhuanFangShi_CheChuang", typeof(string));
            dt.Columns.Add("MZHFS_YunZhuanFangShi_LunYi", typeof(string));
            dt.Columns.Add("MZHFS_YunZhuanFangShi_BuXing", typeof(string));
            dt.Columns.Add("MZHFS_YiShiZhuangTai_QingXing", typeof(string));
            dt.Columns.Add("MZHFS_YiShiZhuangTai_ShiShui", typeof(string));
            dt.Columns.Add("MZHFS_YiShiZhuangTai_QianHunMi", typeof(string));
            dt.Columns.Add("MZHFS_YiShiZhuangTai_ShenHunMi", typeof(string));
            dt.Columns.Add("MZHFS_YiShiZhuangTai_MaZuiWeiXing", typeof(string));
            dt.Columns.Add("MZHFS_PiFuQingKuang_WanHao", typeof(string));
            dt.Columns.Add("MZHFS_PiFuQingKuang_YaHong", typeof(string));
            dt.Columns.Add("MZHFS_PiFuQingKuang_PoKui", typeof(string));
            dt.Columns.Add("MZHFS_PiFuQingKuang_BuWei", typeof(string));
            dt.Columns.Add("MZHFS_JingMaiTongLu_WaiZhouJingMaiChuanCi", typeof(string));
            dt.Columns.Add("MZHFS_JingMaiTongLu_CVC", typeof(string));
            dt.Columns.Add("MZHFS_JingMaiTongLu_PICC", typeof(string));
            dt.Columns.Add("MZHFS_JingMaiTongLu_ShuYeGang", typeof(string));
            dt.Columns.Add("MZHFS_JingMaiTongLu_Wu", typeof(string));
            dt.Columns.Add("MZHFS_JingMaiTongLu_BuWei", typeof(string));
            dt.Columns.Add("MZHFS_CaoZuoZhongLiuZhiYinLiuGuan_Wu", typeof(string));
            dt.Columns.Add("MZHFS_CaoZuoZhongLiuZhiYinLiuGuan_You", typeof(string));
            dt.Columns.Add("MZHFS_CaoZuoZhongLiuZhiYinLiuGuan_WeiZhi", typeof(string));
            dt.Columns.Add("MZHFS_ShengMingTiZheng_MaiBo", typeof(string));
            dt.Columns.Add("MZHFS_ShengMingTiZheng_HuXi", typeof(string));
            dt.Columns.Add("MZHFS_ShengMingTiZheng_XueYa1", typeof(string));
            dt.Columns.Add("MZHFS_ShengMingTiZheng_XueYa2", typeof(string));
            dt.Columns.Add("MZHFS_TengTongPingFen", typeof(string));
            dt.Columns.Add("MZHFS_DaiHuiYaoPin", typeof(string));
            dt.Columns.Add("MZHFS_DaiHuiWuPin_BingLi", typeof(string));
            dt.Columns.Add("MZHFS_DaiHuiWuPin_X_Ray", typeof(string));
            dt.Columns.Add("MZHFS_DaiHuiWuPin_CT", typeof(string));
            dt.Columns.Add("MZHFS_DaiHuiWuPin__PET_CT", typeof(string));
            dt.Columns.Add("MZHFS_DaiHuiWuPin_MR", typeof(string));
            dt.Columns.Add("MZHFS_DaiHuiWuPin_Wu", typeof(string));
            dt.Columns.Add("MZHFS_DaiHuiWuPin_QiTa", typeof(string));
            dt.Columns.Add("MZHFS_HuanZheQuXiang_BingFang", typeof(string));
            dt.Columns.Add("MZHFS_HuanZheQuXiang_ICU", typeof(string));
            dt.Columns.Add("MZHFS_HuanZheQuXiang_CCU", typeof(string));
            dt.Columns.Add("MZHFS_HuanZheQuXiang_CSICU", typeof(string));
            dt.Columns.Add("MZHFS_HuanZheQuXiang_MaZuiHuiFuShi", typeof(string));
            dt.Columns.Add("MZHFS_HuanZheQuXiang_ZiDongChuYuan", typeof(string));
            dt.Columns.Add("MZHFS_HuanZheQuXiang_SiWang", typeof(string));
            dt.Columns.Add("MZHFS_HuanZheQuXiang_JiaoJieShiJian", typeof(string));
            dt.Columns.Add("MZHFS_HuanZheQuXiang_JiaoBanHuShi", typeof(string));
            dt.Columns.Add("MZHFS_HuanZheQuXiang_JieBanHuShi", typeof(string));
        }
        /// <summary>
        /// 检查数据项目
        /// </summary>
        /// <param name="str"></param>
        /// <param name="len"></param>
        /// <returns></returns>
        private bool ChkStr(string str, int len)
        {
            if (string.IsNullOrEmpty(str)) return false;
            if (str.IndexOf("#") < 0) return false;
            if (str.Split('#').Length < len) return false;
            return true;
        }
        private void SurgeryPrints_Load(object sender, EventArgs e)
        {
            axGRPrintViewer1.Start();
        }
    }
}
